load("@rules_proto//proto:defs.bzl", "proto_library")
load("//proto/prost:defs.bzl", "rust_prost_library")
load("//rust:defs.bzl", "rust_binary")

package(default_visibility = ["//proto/prost/private/tests:__subpackages__"])

proto_library(
    name = "echo_proto",
    srcs = [
        "echo.proto",
    ],
)

rust_prost_library(
    name = "echo_rs_proto",
    proto = ":echo_proto",
)

rust_binary(
    name = "client",
    srcs = ["client.rs"],
    edition = "2021",
    deps = [
        ":echo_rs_proto",
        "//proto/prost/private/3rdparty/crates:h2",
        "//proto/prost/private/3rdparty/crates:prost",
        "//proto/prost/private/3rdparty/crates:tokio",
        "//proto/prost/private/3rdparty/crates:tokio-stream",
        "//proto/prost/private/3rdparty/crates:tonic",
    ],
)

rust_binary(
    name = "server",
    srcs = ["server.rs"],
    edition = "2021",
    deps = [
        ":echo_rs_proto",
        "//proto/prost/private/3rdparty/crates:h2",
        "//proto/prost/private/3rdparty/crates:prost",
        "//proto/prost/private/3rdparty/crates:tokio",
        "//proto/prost/private/3rdparty/crates:tokio-stream",
        "//proto/prost/private/3rdparty/crates:tonic",
    ],
)
